package org.jeecg.modules.yw.service;

import javax.annotation.Resource;

import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.yw.entity.FlPrice;
import org.jeecg.modules.yw.mapper.FlPriceMapper;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

@Service
public class FlPriceService  extends ServiceImpl<FlPriceMapper, FlPrice> {
	@Resource 
	private FlPriceMapper flMapper; 
	
	public FlPrice getFlPriceById(int id) {
		FlPrice  obj = flMapper.selectById(id);
		return obj;
	} 
	
	
	public int updateByFlPrice(FlPrice obj) {
		return flMapper.updateById(obj);
	} 
	
	
	 public FlPrice getAllInfoByEnterpriseId(String enterpriseId) {
		 return flMapper.getAllInfoByEnterpriseId(enterpriseId);
	 }
	 
	 public int inserFPrice(FlPrice flPrice) {
		 return flMapper.inserFPrice(flPrice);
	 }
	 
	 public int deleteByEnterpriseId(@Param("enterpriseId") String enterpriseId) {
		 return flMapper.deleteByEnterpriseId(enterpriseId);
	 }
	 
	 public int initiateFlPrice(@Param("enterpriseId") String enterpriseId) {
		 flMapper.deleteByEnterpriseId(enterpriseId);
		 FlPrice obj = flMapper.selectById(1);
		 obj.setEnterpriseId(enterpriseId);
		 inserFPrice(obj);
		 return 1;
	 }
	 
	
}
